package com.ny.dto;

import javax.validation.constraints.Min;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import javax.validation.groups.Default;
import io.swagger.annotations.ApiModelProperty;

/**
 * 购买记录的DTO
 *
 * @author MSI-NB
 * @date 2025-03-08 13:14:38
 */
@Data
public class PurchaseRecordDTO {

    /**
     * 购买记录ID:购买记录ID，必填
     */
    @NotNull(groups = { UpdateGroup.class, DeleteGroup.class, Default.class }, message = "购买记录ID不能为空")
    @ApiModelProperty(value = "购买记录ID:购买记录ID，必填")
    private Integer purchaseId;

    /**
     * 会员ID:会员ID，必填
     */
    @NotNull(groups = { CreateGroup.class, Default.class }, message = "会员ID不能为空")
    @ApiModelProperty(value = "会员ID:会员ID，必填")
    private Integer memberId;

    /**
     * 产品ID:产品ID，必填
     */
    @NotNull(groups = { CreateGroup.class, Default.class }, message = "产品ID不能为空")
    @ApiModelProperty(value = "产品ID:产品ID，必填")
    private Integer productId;

    /**
     * 数量:数量，必填
     */
    @NotNull(groups = { CreateGroup.class, Default.class }, message = "数量不能为空")
    @Min(value = 1, groups = { CreateGroup.class, UpdateGroup.class, Default.class }, message = "数量必须为正数")
    @ApiModelProperty(value = "数量:数量，必填")
    private Integer quantity;

    /**
     * 总金额:总金额，必填
     */
    @NotNull(groups = { CreateGroup.class, Default.class }, message = "总金额不能为空")
    @ApiModelProperty(value = "总金额:总金额，必填")
    private BigDecimal totalAmount;
}
